package org.mics.email.request;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.mics.email.enums.EmailEnums;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 发送验证码请求对象
 * @author mics
 * @date 2020年5月19日
 * @version  1.0
 */
@Data
@Schema(description = "封装验证码对象")
public class EmailVerificationCodeRequest {

	/**
     * 手机号
     */
    @Schema(description = "邮箱账号",required = true)
    @Size(min = 4, max = 32, message = "账号必须是4-32位")
    @NotBlank(message = "邮箱账号不能为空")
    @Pattern(regexp = "[\\w-]+(\\.[\\w-]+)*@([\\w-]+\\.)+\\w{2,14}")
    private String account;

    /**
     * 发送类型(0:登录;1:注册;2:找回密码;3:修改密码)
     */
    @Schema(description = "发送类型",required = true)
    @NotNull(message = "发送类型不能为空")
    private EmailEnums.CodeType type;

}
